﻿@{
    ViewBag.Title = "Báo cáo";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    List<SelectListItem> lstNam = new List<SelectListItem>();
    lstNam.Add(new SelectListItem
    {
        Value = "-1",
        Text = "-- Chọn năm --"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2012",
        Text = "2012"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2013",
        Text = "2013"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2014",
        Text = "2014"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2015",
        Text = "2015"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2016",
        Text = "2016"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2017",
        Text = "2017"
    });


    List<SelectListItem> lstBaocao = new List<SelectListItem>();
    lstBaocao.Add(new SelectListItem
    {
        Value = "-1",
        Text = "[--Chọn báo cáo--]"
    });
    lstBaocao.Add(new SelectListItem
    {
        Value = "0",
        Text = "Mức độ hoàn thành theo mảng"
    });
    lstBaocao.Add(new SelectListItem
    {
        Value = "1",
        Text = "Mức độ hoàn thành của các nhóm đơn vị"
    });
    List<SelectListItem> lstNhom = new List<SelectListItem>();
    lstNhom.Add(new SelectListItem
    {
        Value = "-1",
        Text = "[--Chọn nhóm đơn vị--]"
    });
    

}
<link href="~/Content/standard_form_nhaplieu.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/jquery-ui.1.10.2.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.maskedinput.js")"></script>

<div class="page-bar">
    <ul class="page-breadcrumb" style="padding: 4px;">
        <li>
            <i class="fa fa-home"></i>
            <a href="#">@ViewBag.CurrentMenuName</a>
        </li>
    </ul>
</div>
<div class="row margin-bottom-20">
    <div class="col-md-5">
        <div class="row" style="margin-top:5px;">
            @Html.Label("Năm kế hoạch", new { @class = "col-md-5", id = "lb1" })
            <div class="col-md-7">
                @Html.DropDownList("Namlapbc", lstNam, new { id = "Namlapbc", style = "margin:0px;", @class = "form-control input-sm" })
            </div>
        </div>

    </div>
    <div class="col-md-5">

    </div>
    <div class="col-md-2">
       
    </div>
</div>
<div class="row margin-bottom-20">
    <div class="col-md-5">
        <div class="row" style="margin-top:5px;">
            @Html.Label("Tên báo cáo", new { @class = "col-md-5", id = "lb2" })
            <div class="col-md-7">
                @Html.DropDownList("Baocao", lstBaocao, new { id = "Baocao", style = "margin:0px;", @class = "form-control input-sm" })
            </div>
        </div>

    </div>
    <div class="col-md-5">

    </div>
    <div class="col-md-2">

    </div>
</div>
<div class="row margin-bottom-20">
    <div class="col-md-5">
        <div class="row" style="margin-top:5px;">
            @Html.Label("Nhóm đơn vị", new { @class = "col-md-5", id = "lb3" })
            <div class="col-md-7">
                @Html.DropDownList("Nhomdv", lstNhom, new { id = "Nhomdv", style = "margin:0px;", @class = "form-control input-sm" })
            </div>
        </div>

    </div>
    <div class="col-md-5">

    </div>
    <div class="col-md-2">

    </div>
</div>

<div class="row">
    <center>
        <button type="button" class="btn btn-success" onclick="onViewReportPdf()">In báo cáo</button>
        <button type="button" class="btn btn-success" onclick="onOpenFullData()">Xuất báo cáo</button>
    </center>
</div>




<script>
    @functions{
           public string GetAntiForgeryToken()
           {
               string cookieToken, formToken;
               AntiForgery.GetTokens(null, out cookieToken, out formToken);
               return cookieToken + "," + formToken;
           }
       }
</script>
<script src="@Url.Content("~/Scripts/DHQG/Baocao.js?v=1")" type="text/javascript"></script>
<script>
    $(function () {
        var initData = {
            VerificationToken: "@GetAntiForgeryToken()",
            GetallNamkehoach: "@Url.Action("GetallNamkehoach", "Kehoachnam")",
            Getallnhomdonviorder: "@Url.Action("Getallnhomdonviorder", "Kehoachnam")",

        };
        Baocao.init(initData);
    });

    
    function onOpenFullData() {
        var namKeHoachID = $("#Namlapbc").val();
        var nhomdv = $('#Nhomdv').val();
        var baocao = $('#Baocao').val();
        window.location.href = '/BaoCao/ExpordFullData' + '?namKHId=' + namKeHoachID + '&nhomdv=' + nhomdv + '&baocao=' + baocao;
    }

    function onViewReportPdf() {
        var namKeHoachID = $("#Namlapbc").val();
        var nhomdv = $('#Nhomdv').val();
        var baocao = $('#Baocao').val();
        //window.location.href = '/Kehoachnam/ViewReportPdf' + '?namKHId=' + namKeHoachID + '&nhomdv=' + nhomdv + '&baocao=' + baocao;
        var win = window.open('/BaoCao/ViewReportPdf' + '?namKHId=' + namKeHoachID + '&nhomdv=' + nhomdv + '&baocao=' + baocao, '_blank');
        win.focus();
    }
</script>

